Computers store all data as binary, a series of 1s and 0s. Understanding how different types of data are represented is key.
Number Bases
- Denary (Base 10): The number system we use every day (digits 0-9).
- Binary (Base 2): The number system computers use (digits 0 and 1).
- Hexadecimal (Base 16): A shorthand for binary, using digits 0-9 and A-F.
For example, the denary number 10
is 1010
in binary.
Binary Arithmetic
Simple binary addition: 1 + 1 = 10
(0 carry 1). Also consider shifts (multiplication/division by powers of two) and overflow errors.
Characters, Images & Sound
- Characters: Stored using ASCII or Unicode, each character has a unique binary code.
- Images: Stored as a grid of pixels.
- Resolution: e.g.,
1920 x 1080
.
- Colour Depth: Bits per pixel; higher depth = more colours.
- Sound: Stored by sampling the sound wave.
- Sample Rate: Samples per second; higher rate = better quality.
- Bit Depth: Bits per sample; higher depth = more accurate sound.
Compression
- Lossless Compression: Reduces size without losing data (perfect reconstruction).
- Lossy Compression: Permanently removes some data to reduce size (acceptable for images/audio).